package com.probiz.estore.common.model.system.base;

import java.io.Serializable;
import com.probiz.estore.core.model.BaseObject;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * MsgTemplate Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class MsgTemplateTbl extends BaseObject implements Serializable {

    protected Integer msgTemplateId;
	protected Integer storeId;
	protected String templateCode;
	protected String templateName;
	protected Integer templateItem;
	protected Short type;
	protected String title;
	protected String content;
	protected Short status;
	protected java.util.Date createTime;
	protected java.util.Date updateTime;
	protected Integer createBy;
	protected Integer updateBy;
	protected Integer version;
	protected String labelsVariable;
	protected Short isStoreAdmin;


	/**
	 * Default Empty Constructor for class MsgTemplate
	 */
	public MsgTemplateTbl () {
		super();
	}
	
	/**
	 * Default Key Fields Constructor for class MsgTemplate
	 */
	public MsgTemplateTbl (
		 Integer in_msgTemplateId
        ) {
		this.setMsgTemplateId(in_msgTemplateId);
    }

    

	/**
	 * 	 * @return Integer
     * @hibernate.id column="msgTemplateId" type="java.lang.Integer" generator-class="native"
	 */
	public Integer getMsgTemplateId() {
		return this.msgTemplateId;
	}
	
	/**
	 * Set the msgTemplateId
	 */	
	public void setMsgTemplateId(Integer aValue) {
		this.msgTemplateId = aValue;
	}	

	/**
	 * 商家ID	 * @return Integer
	 * @hibernate.property column="storeId" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getStoreId() {
		return this.storeId;
	}
	
	/**
	 * Set the storeId
	 */	
	public void setStoreId(Integer aValue) {
		this.storeId = aValue;
	}	

	/**
	 * 模板编号（预留字段）	 * @return String
	 * @hibernate.property column="templateCode" type="java.lang.String" length="32" not-null="false" unique="false"
	 */
	public String getTemplateCode() {
		return this.templateCode;
	}
	
	/**
	 * Set the templateCode
	 */	
	public void setTemplateCode(String aValue) {
		this.templateCode = aValue;
	}	

	/**
	 * 模板名（即发送项目，由系统固定）	 * @return String
	 * @hibernate.property column="templateName" type="java.lang.String" length="64" not-null="true" unique="false"
	 */
	public String getTemplateName() {
		return this.templateName;
	}
	
	/**
	 * Set the templateName
	 * @spring.validator type="required"
	 */	
	public void setTemplateName(String aValue) {
		this.templateName = aValue;
	}	

	/**
	 * 模块标识，主要是区分是否属于同种项目	 * @return Integer
	 * @hibernate.property column="templateItem" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getTemplateItem() {
		return this.templateItem;
	}
	
	/**
	 * Set the templateItem
	 * @spring.validator type="required"
	 */	
	public void setTemplateItem(Integer aValue) {
		this.templateItem = aValue;
	}	

	/**
	 * 模板类型：
            0 为Email
            1为msgbox(站内消息)
            2 为SMS
            	 * @return Short
	 * @hibernate.property column="type" type="java.lang.Short" length="5" not-null="true" unique="false"
	 */
	public Short getType() {
		return this.type;
	}
	
	/**
	 * Set the type
	 * @spring.validator type="required"
	 */	
	public void setType(Short aValue) {
		this.type = aValue;
	}	

	/**
	 * 邮件标题	 * @return String
	 * @hibernate.property column="title" type="java.lang.String" length="64" not-null="false" unique="false"
	 */
	public String getTitle() {
		return this.title;
	}
	
	/**
	 * Set the title
	 */	
	public void setTitle(String aValue) {
		this.title = aValue;
	}	

	/**
	 * 邮件、短信内容	 * @return String
	 * @hibernate.property column="content" type="java.lang.String" length="65535" not-null="false" unique="false"
	 */
	public String getContent() {
		return this.content;
	}
	
	/**
	 * Set the content
	 */	
	public void setContent(String aValue) {
		this.content = aValue;
	}	

	/**
	 * 	 * @return Short
	 * @hibernate.property column="status" type="java.lang.Short" length="5" not-null="false" unique="false"
	 */
	public Short getStatus() {
		return this.status;
	}
	
	/**
	 * Set the status
	 */	
	public void setStatus(Short aValue) {
		this.status = aValue;
	}	

	/**
	 * 创建时间	 * @return java.util.Date
	 * @hibernate.property column="createTime" type="java.util.Date" length="19" not-null="false" unique="false"
	 */
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * Set the createTime
	 */	
	public void setCreateTime(java.util.Date aValue) {
		this.createTime = aValue;
	}	

	/**
	 * 更新时间	 * @return java.util.Date
	 * @hibernate.property column="updateTime" type="java.util.Date" length="19" not-null="false" unique="false"
	 */
	public java.util.Date getUpdateTime() {
		return this.updateTime;
	}
	
	/**
	 * Set the updateTime
	 */	
	public void setUpdateTime(java.util.Date aValue) {
		this.updateTime = aValue;
	}	

	/**
	 * 创建者	 * @return Integer
	 * @hibernate.property column="createBy" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getCreateBy() {
		return this.createBy;
	}
	
	/**
	 * Set the createBy
	 */	
	public void setCreateBy(Integer aValue) {
		this.createBy = aValue;
	}	

	/**
	 * 更新者	 * @return Integer
	 * @hibernate.property column="updateBy" type="java.lang.Integer" length="10" not-null="false" unique="false"
	 */
	public Integer getUpdateBy() {
		return this.updateBy;
	}
	
	/**
	 * Set the updateBy
	 */	
	public void setUpdateBy(Integer aValue) {
		this.updateBy = aValue;
	}	

	/**
	 * 版本，初始化为1	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10" not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * Set the version
	 * @spring.validator type="required"
	 */	
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}	

	/**
	 * 	 * @return String
	 * @hibernate.property column="labelsVariable" type="java.lang.String" length="3000" not-null="false" unique="false"
	 */
	public String getLabelsVariable() {
		return this.labelsVariable;
	}
	
	/**
	 * Set the labelsVariable
	 */	
	public void setLabelsVariable(String aValue) {
		this.labelsVariable = aValue;
	}	

	/**
	 * 1表示在网店后台显示	 * @return Short
	 * @hibernate.property column="isStoreAdmin" type="java.lang.Short" length="5" not-null="false" unique="false"
	 */
	public Short getIsStoreAdmin() {
		return this.isStoreAdmin;
	}
	
	/**
	 * Set the isStoreAdmin
	 */	
	public void setIsStoreAdmin(Short aValue) {
		this.isStoreAdmin = aValue;
	}	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof MsgTemplateTbl)) {
			return false;
		}
		MsgTemplateTbl rhs = (MsgTemplateTbl) object;
		return new EqualsBuilder()
				.append(this.msgTemplateId, rhs.msgTemplateId)
				.append(this.storeId, rhs.storeId)
				.append(this.templateCode, rhs.templateCode)
				.append(this.templateName, rhs.templateName)
				.append(this.templateItem, rhs.templateItem)
				.append(this.type, rhs.type)
				.append(this.title, rhs.title)
				.append(this.content, rhs.content)
				.append(this.status, rhs.status)
				.append(this.createTime, rhs.createTime)
				.append(this.updateTime, rhs.updateTime)
				.append(this.createBy, rhs.createBy)
				.append(this.updateBy, rhs.updateBy)
				.append(this.version, rhs.version)
				.append(this.labelsVariable, rhs.labelsVariable)
				.append(this.isStoreAdmin, rhs.isStoreAdmin)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.msgTemplateId) 
				.append(this.storeId) 
				.append(this.templateCode) 
				.append(this.templateName) 
				.append(this.templateItem) 
				.append(this.type) 
				.append(this.title) 
				.append(this.content) 
				.append(this.status) 
				.append(this.createTime) 
				.append(this.updateTime) 
				.append(this.createBy) 
				.append(this.updateBy) 
				.append(this.version) 
				.append(this.labelsVariable) 
				.append(this.isStoreAdmin) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("msgTemplateId", this.msgTemplateId) 
				.append("storeId", this.storeId) 
				.append("templateCode", this.templateCode) 
				.append("templateName", this.templateName) 
				.append("templateItem", this.templateItem) 
				.append("type", this.type) 
				.append("title", this.title) 
				.append("content", this.content) 
				.append("status", this.status) 
				.append("createTime", this.createTime) 
				.append("updateTime", this.updateTime) 
				.append("createBy", this.createBy) 
				.append("updateBy", this.updateBy) 
				.append("version", this.version) 
				.append("labelsVariable", this.labelsVariable) 
				.append("isStoreAdmin", this.isStoreAdmin) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "msgTemplateId";
	}
	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return msgTemplateId;
	}

}